package com.yxuan.springboot.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yxuan.springboot.mapper.SchoolInformationMapper;
import com.yxuan.springboot.model.BaseSchoolInformation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yxuan.springboot.model.SchoolInformation;
import com.yxuan.springboot.service.SchoolInformationService;

import java.util.List;

/**
 * 
 * @author zchao
 *    SchoolInformation业务层实现类
 * @date 2023-05-09 08:56:35
 */
@Service
@Transactional
public class SchoolInformationServiceImpl extends BaseServiceImpl<SchoolInformation> implements SchoolInformationService {

    @Autowired
    private SchoolInformationMapper schoolInformationMapper;

    @Override
    public PageInfo<BaseSchoolInformation> findBaseSchoolInformation(Integer page,
                                                                     Integer limit,
                                                                     List<String> provinces,
                                                                     List<String> natures,
                                                                     List<String> gradations,
                                                                     List<String> schoolTypes,
                                                                     String eryaoyao,
                                                                     String jiubawu,
                                                                     String doubleFirst,
                                                                     String schoolName) {
        PageHelper.startPage(page,limit);
        return new PageInfo<BaseSchoolInformation>(schoolInformationMapper.queryBaseListByPramas(provinces,natures,gradations,schoolTypes,eryaoyao,jiubawu,doubleFirst,schoolName));
    }

    @Override
    public List<SchoolInformation> findProvinceByGroup() {
        return schoolInformationMapper.getProvinceByGroup();
    }

    @Override
    public List<SchoolInformation> findGradationByGroup() {
        return schoolInformationMapper.getGradationByGroup();
    }

    @Override
    public List<SchoolInformation> findSchoolTypeByGroup() {
        return schoolInformationMapper.getSchoolTypeByGroup();
    }

    @Override
    public List<SchoolInformation> findNatureByGroup() {
        return schoolInformationMapper.getNatureByGroup();
    }

    @Override
    public PageInfo<BaseSchoolInformation> findByProfessionalID(Integer page,Integer limit,Long professionalID) {
        PageHelper.startPage(page,limit);
        return new PageInfo<BaseSchoolInformation>(schoolInformationMapper.queryByProfessionalID(professionalID));
    }

    @Override
    public List<SchoolInformation> getSchoolInfoByIdMoreInfor(List item) {
        return schoolInformationMapper.querySchoolInfoByIdMoreInfor(item);
    }
}
